﻿@{
    ViewBag.Title = "Video.js播放M3U8";
    Layout = "~/Views/Shared/_MyLayout.cshtml";
}
@section head{
    <script src="~/Scripts/vide7.5.5/js/video.min.js"></script>
    <link href="~/Scripts/vide7.5.5/css/video-js.min.css" rel="stylesheet" type="text/css" />
    <script src="~/Scripts/vide7.5.5/videojs-contrib-hls.js"></script>
    
    <style>
        .m {
            width: 740px;
            height: 400px;
            margin-left: auto;
            margin-right: auto;
            margin-top: 100px;
        }

        .video-js .vjs-time-control {
            display: block;
        }

        .video-js .vjs-remaining-time {
            display: none;
        }
    
    </style>
}


<div class="m">
    <video id="example_video_1" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="none" width="640" height="264"
           data-setup="{}">
        @*<source src="/Upload/OutPut/20200225125205/S.H.E.belief.mp4.m3u8" type='application/x-mpegURL' />*@
        <source src="/upload/OutPut/20200227200901/277F58C96E80A9352A32ABCCE1AE8CA7.m3u8" type='application/x-mpegURL' />
    </video>
</div>

<script type="text/javascript">
    var videoObj = videojs('example_video_1');
    var option = {};
    /*option只是一个参数,function onPlayerReady就是播放器初始化完成时会执行的回调函数*/
    //var myPlayer = videojs('my-video', { "poster": "", "controls": "true" }, function onPlayerReady() {
    //    var myPlayer = this;
    //    myPlayer.src({ src: "/Upload/OutPut/20200225125205/S.H.E.belief.mp4.m3u8", type: "application/x-mpegURL" });
    //    this.play();
    //});





</script>


